public class RegularPolygon extends Shape{
    private int n;
    private double s;

    public RegularPolygon(int n, double s) {
        this.n = n;
        this.s = s;
    }

    @Override
    public double getArea() {
        return n*s*s/(Math.tan((3.1415926/n))*4);
    }

    @Override
    public double getPerimeter() {
        return n*s;
    }
}
